import { http } from '@/utils/http'
import type { Prescription } from '@/types/prescription'
import type { PageResult } from '@/types/global'

export function listPrescriptions() {
  return http<PageResult<Required<Prescription>>>({
    method: 'GET',
    url: '/prescription/prescription'
  })
}

export function getPrescription(id: number) {
  return http<Required<Prescription>>({
    method: 'GET',
    url: `/prescription/prescription/${id}`
  })
}

export function payPrescription(id: number) {
  return http({
    method: 'POST',
    url: `/prescription/prescription/pay/${id}`
  })
}
